package prictice.drpc;

import org.apache.storm.Config;
import org.apache.storm.generated.AuthorizationException;
import org.apache.storm.generated.DRPCExecutionException;
import org.apache.storm.thrift.TException;
import org.apache.storm.thrift.transport.TTransportException;
import org.apache.storm.utils.DRPCClient;

/**
 * @Package prictice.drpc
 * @Description:
 * @Author elwyn
 * @Date 2017/9/18 21:59
 * @Email elonyong@163.com
 */
public class MyDrpcClient {
    public static void main(String[] args) {
        try {
            DRPCClient drpcClient = new DRPCClient(new Config(), "192.168.128.141", 3772);
            String execute = drpcClient.execute("exclamation", "hehe");
            System.out.println(execute);
        } catch (TTransportException e) {
            e.printStackTrace();
        } catch (DRPCExecutionException e) {
            e.printStackTrace();
        } catch (AuthorizationException e) {
            e.printStackTrace();
        } catch (TException e) {
            e.printStackTrace();
        }
    }
}
